home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / utmisc1 / calctrnr.lha / Calctrainer / Source / rechentrainer_cat.c < prev    next >
C/C++ Source or Header  |  1996-01-12  |  11KB  |  208 lines

  1. /* Prototypes */
  2. #include <clib/locale_protos.h>
  3. #include <clib/dos_protos.h>
  4.  
  5. /* Pragmas */
  6. #ifdef AZTEC_C
  7. #include <pragmas/locale_lib.h>
  8. #endif /*   AZTEC_C                 */
  9.  
  10. #if defined(__SASC)  ||  defined(_DCC)  ||  defined(__MAXON__)
  11. #include <pragma/locale_lib.h>     
  12. #endif  /*  __SASC  ||  _DCC  ||  __MAXON__     */
  13.  
  14. #ifdef __GNUC__
  15. #include <inline/locale.h>
  16. #endif  /*  __GNUC__    */
  17.  
  18. static LONG rechentrainer_Version = 1;
  19. static const STRPTR rechentrainer_BuiltInLanguage = (STRPTR) "english";
  20.  
  21. struct FC_Type
  22. {   LONG   ID;
  23.     char *Str;
  24. };
  25.  
  26. /* Definitions */
  27. const struct FC_Type _MSG_AppDescription = { 0, "The Calculationtrainer for Children" };
  28. const struct FC_Type _MSG_AppCopyright = { 1, "© by Jürgen Späth" };
  29. const struct FC_Type _MSG_WI_Auswahl = { 2, "Calculationtrainer" };
  30. const struct FC_Type _MSG_MNlabel1Projekt = { 3, "Project" };
  31. const struct FC_Type _MSG_MNlabel1ber = { 4, "About" };
  32. const struct FC_Type _MSG_MNlabel1berChar = { 5, "b_" };
  33. const struct FC_Type _MSG_MNlabel1Punktestand = { 6, "Score" };
  34. const struct FC_Type _MSG_MNlabel1PunktestandChar = { 7, "c_" };
  35. const struct FC_Type _MSG_MNlabel1Beenden = { 8, "Quit" };
  36. const struct FC_Type _MSG_MNlabel1BeendenChar = { 9, "q_" };
  37. const struct FC_Type _MSG_MNlabel1Speichern = { 10, "Save score" };
  38. const struct FC_Type _MSG_MNlabel1SpeichernChar = { 11, "s_" };
  39. const struct FC_Type _MSG_MNlabel1Laden = { 12, "Load score" };
  40. const struct FC_Type _MSG_MNlabel1LadenChar = { 13, "l_" };
  41. const struct FC_Type _MSG_MNlabel1Rechnungsarten = { 14, "Calculation method" };
  42. const struct FC_Type _MSG_MNlabel1AdditionNotify8 = { 15, " " };
  43. const struct FC_Type _MSG_MNlabel1AdditionNotify9 = { 16, " " };
  44. const struct FC_Type _MSG_MNlabel1AdditionNotify10 = { 17, " " };
  45. const struct FC_Type _MSG_MNlabel1AdditionNotify11 = { 18, " " };
  46. const struct FC_Type _MSG_MNlabel1AdditionNotify12 = { 19, " " };
  47. const struct FC_Type _MSG_MNlabel1Addition = { 20, "Addition" };
  48. const struct FC_Type _MSG_MNlabel1AdditionChar = { 21, "a_" };
  49. const struct FC_Type _MSG_MNlabel1SubtraktionNotify8 = { 22, " " };
  50. const struct FC_Type _MSG_MNlabel1SubtraktionNotify9 = { 23, " " };
  51. const struct FC_Type _MSG_MNlabel1SubtraktionNotify10 = { 24, " " };
  52. const struct FC_Type _MSG_MNlabel1SubtraktionNotify11 = { 25, " " };
  53. const struct FC_Type _MSG_MNlabel1SubtraktionNotify12 = { 26, " " };
  54. const struct FC_Type _MSG_MNlabel1Subtraktion = { 27, "Subtraction" };
  55. const struct FC_Type _MSG_MNlabel1SubtraktionChar = { 28, "u_" };
  56. const struct FC_Type _MSG_MNlabel1MultiplikationNotify8 = { 29, " " };
  57. const struct FC_Type _MSG_MNlabel1MultiplikationNotify9 = { 30, " " };
  58. const struct FC_Type _MSG_MNlabel1MultiplikationNotify10 = { 31, " " };
  59. const struct FC_Type _MSG_MNlabel1MultiplikationNotify11 = { 32, " " };
  60. const struct FC_Type _MSG_MNlabel1MultiplikationNotify12 = { 33, " " };
  61. const struct FC_Type _MSG_MNlabel1Multiplikation = { 34, "Multiplication" };
  62. const struct FC_Type _MSG_MNlabel1MultiplikationChar = { 35, "m_" };
  63. const struct FC_Type _MSG_MNlabel1DivisionNotify8 = { 36, " " };
  64. const struct FC_Type _MSG_MNlabel1DivisionNotify9 = { 37, " " };
  65. const struct FC_Type _MSG_MNlabel1DivisionNotify10 = { 38, " " };
  66. const struct FC_Type _MSG_MNlabel1DivisionNotify11 = { 39, " " };
  67. const struct FC_Type _MSG_MNlabel1DivisionNotify12 = { 40, " " };
  68. const struct FC_Type _MSG_MNlabel1Division = { 41, "Division" };
  69. const struct FC_Type _MSG_MNlabel1DivisionChar = { 42, "d_" };
  70. const struct FC_Type _MSG_GR_grp_0Title = { 43, "Selection" };
  71. const struct FC_Type _MSG_BT_MultiNotify5 = { 44, "" };
  72. const struct FC_Type _MSG_BT_MultiNotify6 = { 45, "" };
  73. const struct FC_Type _MSG_BT_MultiNotify7 = { 46, "" };
  74. const struct FC_Type _MSG_BT_MultiNotify8 = { 47, "" };
  75. const struct FC_Type _MSG_BT_MultiNotify9 = { 48, "" };
  76. const struct FC_Type _MSG_BT_MultiNotify10 = { 49, "" };
  77. const struct FC_Type _MSG_BT_Multi = { 50, "_Multiplication" };
  78. const struct FC_Type _MSG_BT_DiviNotify5 = { 51, "" };
  79. const struct FC_Type _MSG_BT_DiviNotify6 = { 52, "" };
  80. const struct FC_Type _MSG_BT_DiviNotify7 = { 53, "" };
  81. const struct FC_Type _MSG_BT_DiviNotify8 = { 54, "" };
  82. const struct FC_Type _MSG_BT_DiviNotify9 = { 55, "" };
  83. const struct FC_Type _MSG_BT_DiviNotify10 = { 56, "" };
  84. const struct FC_Type _MSG_BT_Divi = { 57, "_Division" };
  85. const struct FC_Type _MSG_BT_AddiNotify5 = { 58, "" };
  86. const struct FC_Type _MSG_BT_AddiNotify6 = { 59, "" };
  87. const struct FC_Type _MSG_BT_AddiNotify7 = { 60, "" };
  88. const struct FC_Type _MSG_BT_AddiNotify8 = { 61, "" };
  89. const struct FC_Type _MSG_BT_AddiNotify9 = { 62, "" };
  90. const struct FC_Type _MSG_BT_AddiNotify10 = { 63, "" };
  91. const struct FC_Type _MSG_BT_Addi = { 64, "_Addition" };
  92. const struct FC_Type _MSG_BT_SubtrNotify5 = { 65, "" };
  93. const struct FC_Type _MSG_BT_SubtrNotify6 = { 66, "" };
  94. const struct FC_Type _MSG_BT_SubtrNotify7 = { 67, "" };
  95. const struct FC_Type _MSG_BT_SubtrNotify8 = { 68, "" };
  96. const struct FC_Type _MSG_BT_SubtrNotify9 = { 69, "" };
  97. const struct FC_Type _MSG_BT_SubtrNotify10 = { 70, "" };
  98. const struct FC_Type _MSG_BT_Subtr = { 71, "_Subtraction" };
  99. const struct FC_Type _MSG_GR_grp_1Title = { 72, "Result" };
  100. const struct FC_Type _MSG_BT_Erg = { 73, "S_core" };
  101. const struct FC_Type _MSG_BT_Ende = { 74, "_Quit(Esc)" };
  102. const struct FC_Type _MSG_WI_Multiplikation = { 75, "Calculationtrainer" };
  103. const struct FC_Type _MSG_GROUP_ROOT_1Title = { 76, "Multiplication" };
  104. const struct FC_Type _MSG_TX_label_0 = { 77, "               How much Calculations ?                    " };
  105. const struct FC_Type _MSG_TX_label_1 = { 78, " Term:" };
  106. const struct FC_Type _MSG_Erg_Mul = { 79, " Result:" };
  107. const struct FC_Type _MSG_Mul_RichtigTitle = { 80, "Right" };
  108. const struct FC_Type _MSG_Mul_Richtig = { 81, " " };
  109. const struct FC_Type _MSG_Mul_FalschTitle = { 82, "Wrong" };
  110. const struct FC_Type _MSG_WI_Divi = { 83, "Calculationtrainer" };
  111. const struct FC_Type _MSG_GROUP_ROOT_2Title = { 84, "Division" };
  112. const struct FC_Type _MSG_TX_label_2 = { 85, "               How much Calculations ?                    " };
  113. const struct FC_Type _MSG_TX_label_3 = { 86, " Term:" };
  114. const struct FC_Type _MSG_Erg_Div = { 87, " Result:" };
  115. const struct FC_Type _MSG_Div_RichtigTitle = { 88, "Right" };
  116. const struct FC_Type _MSG_Div_FalschTitle = { 89, "Wrong" };
  117. const struct FC_Type _MSG_WI_Addieren = { 90, "Calculationtrainer" };
  118. const struct FC_Type _MSG_GROUP_ROOT_3Title = { 91, "Addition" };
  119. const struct FC_Type _MSG_TX_label_4 = { 92, "               How much Calculations ?                    " };
  120. const struct FC_Type _MSG_TX_label_5 = { 93, " Term:" };
  121. const struct FC_Type _MSG_Erg_Addi = { 94, " Result:" };
  122. const struct FC_Type _MSG_Addi_RichtigTitle = { 95, "Right" };
  123. const struct FC_Type _MSG_Addi_FalschTitle = { 96, "Wrong" };
  124. const struct FC_Type _MSG_WI_Subtraktion = { 97, "Calculationtrainer" };
  125. const struct FC_Type _MSG_GROUP_ROOT_4Title = { 98, "Subtraction" };
  126. const struct FC_Type _MSG_TX_label_6 = { 99, "               How much Calculations ?                    " };
  127. const struct FC_Type _MSG_TX_label_7 = { 100, " Term:" };
  128. const struct FC_Type _MSG_Erg_Subtr = { 101, " Result:" };
  129. const struct FC_Type _MSG_Subtr_RichtigTitle = { 102, "Right" };
  130. const struct FC_Type _MSG_Subtr_FalschTitle = { 103, "Wrong" };
  131. const struct FC_Type _MSG_WI_Ergebnis = { 104, "Calculationtrainer" };
  132. const struct FC_Type _MSG_GROUP_ROOT_5Title = { 105, "Statistic" };
  133. const struct FC_Type _MSG_GR_grp_17Title = { 106, "Multiplication" };
  134. const struct FC_Type _MSG_LA_label_4 = { 107, "\033c Right:" };
  135. const struct FC_Type _MSG_LA_Label_5 = { 108, "\033c Wrong:" };
  136. const struct FC_Type _MSG_Gauge_Mul = { 109, "%ld%" };
  137. const struct FC_Type _MSG_GR_grp_20Title = { 110, "Division" };
  138. const struct FC_Type _MSG_LA_label_7 = { 111, "\033c Right:" };
  139. const struct FC_Type _MSG_LA_Label_8 = { 112, "\033c Wrong:" };
  140. const struct FC_Type _MSG_Gauge_Div = { 113, "%ld%" };
  141. const struct FC_Type _MSG_GR_grp_23Title = { 114, "Addition" };
  142. const struct FC_Type _MSG_LA_label_10 = { 115, "\033c Right:" };
  143. const struct FC_Type _MSG_LA_Label_11 = { 116, "\033c Wrong:" };
  144. const struct FC_Type _MSG_Gauge_Addi = { 117, "%ld%" };
  145. const struct FC_Type _MSG_GR_grp_26Title = { 118, "Subtraction" };
  146. const struct FC_Type _MSG_LA_label_13 = { 119, "\033c Right:" };
  147. const struct FC_Type _MSG_LA_Label_14 = { 120, "\033c Wrong:" };
  148. const struct FC_Type _MSG_Gauge_Subtr = { 121, "%ld%" };
  149. const struct FC_Type _MSG_GR_grp_29Title = { 122, "Overall Statistic" };
  150. const struct FC_Type _MSG_LA_Label_16 = { 123, " Right:" };
  151. const struct FC_Type _MSG_LA_label_17 = { 124, " Wrong:" };
  152. const struct FC_Type _MSG_Gauge_Ges = { 125, "%ld%" };
  153. const struct FC_Type _MSG_WI_info = { 126, "Calculationtrainer" };
  154. const struct FC_Type _MSG_GROUP_ROOT_6Title = { 127, "Info Window" };
  155. const struct FC_Type _MSG_TX_label_8 = { 128, "\nThe ultimative\n\nCalculationtrainer for\n\nChildren in\n\nSchoolage\n\n\0330 \033b© by Jürgen Späth\n\n\033nCompiled with © MAXON\n\n at 5.January 1996\n\nMUI © by Stefan Stuntz\n\033b&\n\033n  MUI-Builder © by Eric Totel  \n" };
  156. const struct FC_Type _MSG_BT_Info_ok = { 129, "_OK" };
  157. const struct FC_Type _MSG_Rubish = { 130, "\0338Rubish" };
  158. const struct FC_Type _MSG_Right = { 131, "\0338Right !!" };
  159. const struct FC_Type _MSG_Wrong = { 132, "\0338Wrong !!" };
  160. const struct FC_Type _MSG_Ready = { 133, "\0338Ready !!" };
  161. const struct FC_Type _MSG_Title = { 134, "Calculationtrainer" };
  162. static struct Catalog *rechentrainer_Catalog = NULL;
  163.  
  164. void OpenAppCatalog(struct Locale *loc, STRPTR language)
  165. {
  166.         LONG tag, tagarg;
  167.         extern struct Library *LocaleBase;
  168.         extern void CloseAppCatalog(void);
  169.  
  170.         CloseAppCatalog(); /* Not needed if the programmer pairs OpenAppCatalog
  171.                         and CloseAppCatalog right, but does no harm.  */
  172.  
  173.         if (LocaleBase != NULL  &&  rechentrainer_Catalog == NULL)
  174.         {
  175.         if (language == NULL)
  176.                 tag = TAG_IGNORE;
  177.         else
  178.         {
  179.                 tag = OC_Language;
  180.                 tagarg = (LONG) language;
  181.         }
  182.         rechentrainer_Catalog = OpenCatalog(loc, (STRPTR) "calctrainer.catalog",
  183.                         OC_BuiltInLanguage, rechentrainer_BuiltInLanguage,
  184.                         tag, tagarg,
  185.                         OC_Version, rechentrainer_Version,
  186.                         TAG_DONE);
  187.         }
  188. }
  189.  
  190. void CloseAppCatalog(void)
  191. {
  192.         if (LocaleBase)        
  193.                 CloseCatalog(rechentrainer_Catalog);
  194.         rechentrainer_Catalog = NULL;
  195. }
  196.  
  197. char * GetRechenString(APTR fcstr)
  198. {
  199.         char *defaultstr;
  200.         LONG strnum;
  201.  
  202.         strnum = ((struct FC_Type *) fcstr)->ID;
  203.         defaultstr = ((struct FC_Type *) fcstr)->Str;
  204.  
  205.         return(rechentrainer_Catalog ? (char *)GetCatalogStr(rechentrainer_Catalog, strnum, defaultstr) :
  206.                         defaultstr);
  207. }
  208.